package com.welleys.stu.spring.aop;

import com.welleys.stu.spring.aop.api.Greet;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Created by suzhiwei on 2017/6/15.
 */
public class App {
    public static void main(String[] args){
        ApplicationContext appContext = new ClassPathXmlApplicationContext("/aop.xml");
        Greet helloGreet = (Greet) appContext.getBean("helloGreet");
        Greet hugGreet = (Greet) appContext.getBean("hugGreet");

        helloGreet.greet();
        hugGreet.greet();

        ((ClassPathXmlApplicationContext)appContext).close();
    }
}
